package com.wl.shop.entity;

import java.util.List;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.google.common.collect.Lists;
@TableName("sys_menu")
public class Menu extends DataEntity {

	private static final long serialVersionUID = 1L;
	@TableField("parent_id")
	private String parentId;	// 父级菜单
	@TableField("parent_ids")
	private String parentIds; // 所有父级编号
	private String name; 	// 名称
	private String href; 	// 链接
	private String target; 	// 目标（ mainFrame、_blank、_self、_parent、_top）
	private String icon; 	// 图标
	private Integer sort; 	// 排序
	@TableField("is_show")
	private Boolean isShow; 	// 是否在菜单中显示（1：显示；0：不显示）
	private String permission; // 权限标识
	@TableField("parent_name")
	private String parentName;
	@TableField(exist = false)
	private List<Menu> childList = Lists.newArrayList();
	
	public Menu() {
		// TODO Auto-generated constructor stub
		super();
		this.isShow = true;
	}
	
	public Menu(String id){
		super(id);
	}
	
	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getParentIds() {
		return parentIds;
	}
	public void setParentIds(String parentIds) {
		this.parentIds = parentIds;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getHref() {
		return href;
	}
	public void setHref(String href) {
		this.href = href;
	}
	public String getTarget() {
		return target;
	}
	public void setTarget(String target) {
		this.target = target;
	}
	public String getIcon() {
		return icon;
	}
	public void setIcon(String icon) {
		this.icon = icon;
	}
	public Integer getSort() {
		return sort;
	}
	public void setSort(Integer sort) {
		this.sort = sort;
	}
	public Boolean getIsShow() {
		return isShow;
	}
	public void setIsShow(Boolean isShow) {
		this.isShow = isShow;
	}
	public String getPermission() {
		return permission;
	}
	public void setPermission(String permission) {
		this.permission = permission;
	}
	public String getParentName() {
		return parentName;
	}
	public void setParentName(String parentName) {
		this.parentName = parentName;
	}
	public List<Menu> getChildList() {
		return childList;
	}

	public void setChildList(List<Menu> childList) {
		this.childList = childList;
	}

	@JSONField(serialize = false)
	public static String getRootId(){
		return "1";
	}
	@Override
	public String toString() {
		return name;
	}
	
}
